package net.xdclass.anno;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/path")
public class UserController2 {

//    @Autowired
//    private UserService userService;

    @MyAnnotation()
    @GetMapping("/getUserById")
    public Object getUserById(@RequestParam("userId") String userId ) {
        return "hihihihi"+userId;
    }
// http://localhost:8080/path/getUserById?userId=2a
//net.xdclass.anno.MyAnnotationAop         : 请求参数：["2a"]
// net.xdclass.anno.MyAnnotationAop         : 返回结果：hihihihi

    @MyAnnotation()
    @GetMapping("/a")
    public Object getUserById( ) {
        return "hihihihi";
    }
    // http://localhost:8080/path/a

@MyJiaMiAnn(value = "加密2")
    @GetMapping("/jiami")
    public Object getUserById2(@RequestParam("userId") String userId ) {
        return "hihihihi"+userId;
    }
    // http://localhost:8080/path/jiami?userId=2a
    // 浏览器上面返回  数据已经经过加密的处理了

}
